import { controller_energy } from "utils/constants/globalconstant";

export class  energyhelp
{
    /**
     *@descript 计算升级到指定的等级还需要多少能量
    */
    public static upgrader_energy(constroller:StructureController,targetLevel:number)
    {
        if(constroller.level>=targetLevel)
        {
            return 0;
        }
        let sum_energy =constroller.progressTotal- constroller.progress;
        for(let i=constroller.level+1;i<8&& i<targetLevel;i++)
        {
            sum_energy+=controller_energy[i];
        }
        return sum_energy;
    }

    public static build_energy(constroller:ConstructionSite )
    {
        return constroller.progressTotal-constroller.progress;
    }
}